# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=php7-pecl-mcrypt
_extname=mcrypt
pkgver=1.0.5
pkgrel=0
pkgdesc="Provides PHP 7 bindings for the unmaintained libmcrypt - PECL"
url="https://pecl.php.net/package/mcrypt"
arch="all"
license="PHP-3.01"
depends="php7-common"
makedepends="php7-dev libmcrypt-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir/$_extname-$pkgver"
provides="php7-mcrypt=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-mcrypt" # for backward compatibility

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php7/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
fe9afd0987ddbcbb0a9fc5e8313c08c65ac6afd606cce586fe30600ab149b4f4add917bb0319f803942833a88f520f65e2e94bbcc6c58e2075e829509e7dfac5  php-pecl-mcrypt-1.0.5.tgz
"
